Skip to content

Conversation

Karthik-K-N
Copy link
Contributor

What this PR does / why we need it:

If we blindly follow the Developing Cluster API with Tilt in CAPI book for Kubevirt provider references and use the given tilt file content, we hit the following error

ERROR: Traceback (most recent call last):
  /root/cluster-api/Tiltfile:46:13: in <toplevel>
Error in fail: default_registry is required when not using a local registry, please add it to your tilt-settings.yaml/json

This PR would add the default_registry key into the tilt file.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label labels Jun 23, 2025
@k8s-ci-robot
Copy link
Contributor

This PR is currently missing an area label, which is used to identify the modified component when generating release notes.

Area labels can be added by org members by writing /area ${COMPONENT} in a comment

Please see the labels list for possible areas.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot requested review from elmiko and sivchari June 23, 2025 17:31
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Karthik-K-N
Copy link
Contributor Author

/cc @johananl

@k8s-ci-robot k8s-ci-robot requested a review from johananl June 23, 2025 17:31
@johananl
Copy link
Member

I can't reproduce this @Karthik-K-N. Can you specify your Tilt version, the commit you've used and your tilt-settings.yaml file?

@Karthik-K-N
Copy link
Contributor Author

Karthik-K-N commented Jun 25, 2025

I can't reproduce this @Karthik-K-N. Can you specify your Tilt version, the commit you've used and your tilt-settings.yaml file?

Sure, here it is

[root@karthik-vm cluster-api]# tilt version
v0.35.0, built 2025-06-13


[root@karthik-vm cluster-api]# git log --oneline
c28b41336 (HEAD -> main, origin/main, origin/HEAD) Merge pull request #12382 from mboersma/fix-capz-link
59b0f3fec Merge pull request #12357 from Tomy2e/scaleway
4f54ba085 Fix broken link to CAPZ prerequisites
1efdb87b2 ⚠️ Drop unnecessary fields from contract-versioned object references (#12356)

[root@karthik-vm cluster-api]# tilt up --stream=true
Tilt started on http://localhost:10350/
v0.35.0, built 2025-06-13
WARNING: Error loading config file: /root/.docker/config.json: : read /root/.docker/config.json: is a directory
WARNING: Error loading config file: /root/.docker/config.json: : read /root/.docker/config.json: is a directory

Initial Build
Loading Tiltfile at: /root/cluster-api/Tiltfile
local: command -v kubectl || true
local: docker version || podman version
local: go env GOOS
 → linux
local: go env GOARCH
 → amd64
local: kubectl get cm -n kube-public local-registry-hosting || true
ERROR: Traceback (most recent call last):
  /root/cluster-api/Tiltfile:46:13: in <toplevel>
Error in fail: default_registry is required when not using a local registry, please add it to your tilt-settings.yaml/json


[root@karthik-vm cluster-api]# cat tilt-settings.yaml
enable_providers:
- kubevirt
- kubeadm-bootstrap
- kubeadm-control-plane
provider_repos:
# Path to a local clone of CAPK (replace with actual path)
- ../cluster-api-provider-kubevirt
kustomize_substitutions:
  # CAPK needs access to the containerd socket (replace with actual path)
  CRI_PATH: "/var/run/containerd/containerd.sock"
  KUBERNETES_VERSION: "v1.30.1"
  # An example - replace with an appropriate container disk image for the desired k8s version
  NODE_VM_IMAGE_TEMPLATE: "quay.io/capk/ubuntu-2204-container-disk:v1.30.1"
# Allow deploying CAPK workload clusters from the Tilt UI (optional)
template_dirs:
  kubevirt:
  - ../cluster-api-provider-kubevirt/templates

@johananl
Copy link
Member

Looks like the error you're getting is because there is some problem with the wiring of the local container registry:

cluster-api/Tiltfile

Lines 43 to 46 in 4852b67

usingLocalRegistry = str(local(kubectl_cmd + " get cm -n kube-public local-registry-hosting || true", quiet = True))
if not usingLocalRegistry:
if settings.get("default_registry", "") == "":
fail("default_registry is required when not using a local registry, please add it to your tilt-settings.yaml/json")

When I follow your instructions I do indeed get the error.

Please try the following:

make kind-cluster-kubevirt
make tilt-up

Works for me.

@Karthik-K-N
Copy link
Contributor Author

Looks like the error you're getting is because there is some problem with the wiring of the local container registry:

cluster-api/Tiltfile

Lines 43 to 46 in 4852b67

usingLocalRegistry = str(local(kubectl_cmd + " get cm -n kube-public local-registry-hosting || true", quiet = True))
if not usingLocalRegistry:
if settings.get("default_registry", "") == "":
fail("default_registry is required when not using a local registry, please add it to your tilt-settings.yaml/json")

When I follow your instructions I do indeed get the error.

Please try the following:

make kind-cluster-kubevirt
make tilt-up

Works for me.

True that, but even with it I hit the issue. Even I can see the result

# kubectl get cm -n kube-public local-registry-hosting
NAME                     DATA   AGE
local-registry-hosting   1      31m

@Karthik-K-N
Copy link
Contributor Author

Not sure what should I do with this PR, should I close it?

@sbueringer
Copy link
Member

sbueringer commented Sep 15, 2025

Looks like the error you're getting is because there is some problem with the wiring of the local container registry:

cluster-api/Tiltfile

Lines 43 to 46 in 4852b67

usingLocalRegistry = str(local(kubectl_cmd + " get cm -n kube-public local-registry-hosting || true", quiet = True))
if not usingLocalRegistry:
if settings.get("default_registry", "") == "":
fail("default_registry is required when not using a local registry, please add it to your tilt-settings.yaml/json")

When I follow your instructions I do indeed get the error.
Please try the following:

make kind-cluster-kubevirt
make tilt-up

Works for me.

True that, but even with it I hit the issue. Even I can see the result

# kubectl get cm -n kube-public local-registry-hosting
NAME                     DATA   AGE
local-registry-hosting   1      31m

So you get an error from tilt even though you shouldn't because the ConfigMap exists?

And it looks like not everyone is getting this issue? (I don't get it with regular make tilt-up (I'm not using kube virt))

I think I wouldn't change the documentation if we don't know why it only fails in some cases. Maybe you can do some further debugging of the kubectl command that is run to check if the ConfigMap exists. Maybe there's an error there

@Karthik-K-N
Copy link
Contributor Author

/close

Tried just now and able to see all the controllers are up, Not sure what was causing the issue earlier, Closing this. Sorry and Thank you.

@k8s-ci-robot
Copy link
Contributor

@Karthik-K-N: Closed this PR.

In response to this:

/close

Tried just now and able to see all the controllers are up, Not sure what was causing the issue earlier, Closing this. Sorry and Thank you.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sbueringer
Copy link
Member

Perfect. All good, no worries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants